//
//  ViewController.m
//  iOSLesson1
//
//  Created by 宋 on 15/11/2.
//  Copyright (c) 2015年 宋. All rights reserved.
//

#import "ViewController.h"
@interface ViewController ()
{
    UILabel * xiao;
}
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor = [UIColor yellowColor];
   
    xiao = [UILabel new];
    xiao.text = @"欢迎光临！";
    [xiao sizeToFit ];
    xiao.center = CGPointMake(self.view.frame.size.width/2.0, self.view.frame.size.height/2.0 );
    xiao.textColor = [UIColor blackColor];
    [self.view addSubview:xiao];
    
}
- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    /*[UIView animateWithDuration:1.5 animations:^{
xiao.center = CGPointMake(self.view.frame.size.width/2.0, self.view.frame.size.height - 500 );
    }];*/

    
    /*[UIView animateWithDuration:0.6 delay:0 usingSpringWithDamping:0.1 initialSpringVelocity:0 options:UIViewAnimationOptionCurveEaseIn animations:^{
        xiao.center = CGPointMake(self.view.frame.size.width/2.0, self.view.frame.size.height - 280 );
    } completion:nil];*/
    
    UIButton * btn =[UIButton buttonWithType:UIButtonTypeRoundedRect];
    btn.frame = CGRectMake(100, 100, 120, 800);
    [btn setTitle:@"按钮" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(onClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    
}




- (void)onClick:(id)sender{
    [UIView animateWithDuration:1.6 animations:^{xiao.center = CGPointMake(self.view.frame.size.width/2.0,self.view.frame.size.height - 800);
    }];

}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
